package com.zygh.policeasset.controller;

import com.zygh.policeasset.component.CommonResult;
import com.zygh.policeasset.pojo.BusinessProcess;
import com.zygh.policeasset.service.BusinessProcessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping({"businessProcess"})
@Api(tags = {"业务流程表"})
@RestController
public class BusinessProcessController {
    @Resource
    BusinessProcessService businessProcessService;

    @GetMapping({"/queryById"})
    @ApiOperation("通过ID查询")
    public BusinessProcess queryById(Integer id) {
        return this.businessProcessService.queryById(id);
    }

    @GetMapping({"/queryAll"})
    @ApiOperation("获取项目分类列表")
    public Object queryAll(Integer businessProcessMain) {
        return this.businessProcessService.queryAll(businessProcessMain);
    }

    @PostMapping({"/insert"})
    @ApiOperation("添加")
    public CommonResult insert(@RequestBody BusinessProcess businessProcess) {
        return this.businessProcessService.insert(businessProcess);
    }

    @PostMapping({"/update"})
    @ApiOperation("修改")
    public CommonResult update(@RequestBody BusinessProcess businessProcessList) {
        return this.businessProcessService.update(businessProcessList);
    }

    @DeleteMapping({"/delete/{id}"})
    @ApiOperation("删除")
    public CommonResult delete(@PathVariable Integer id) {
        return this.businessProcessService.deleteById(id);
    }
}